
<template tag="以下文档内容为hycli自动生成">
  <div>
   
    <!-- 指派 -->
    <el-dialog v-model="conf.aaaxp_visible" 
        draggable
      title="指派" :close-on-click-modal="false"  width="60%"
      top="10vh" 
      :before-close="hide_aaaxp">
    <el-form  ref="fm_aaaxp" :model="form_aaaxp" :rules="rules_aaaxp">
    <el-row>
    <el-col :span="24">
    <!-- {"index":42,"raw":"assigned_to","name":"assigned_to","cname":"AssignedTo","type":{"raw":"number(8)","name":"number","len":8,"dlen":0},"defValue":"","allowNull":true,"constraints":["l","le","c","v","sl(dmaster,-,#lob_id)","tp(radio,c-w)","w","ps(full)","lw(60)"],"desc":{"raw":"指派","name":"指派"}} -->
    <el-form-item prop="assigned_to" label="指派" label-width="100px" label-position="right">
      <el-radio-group v-model="form_aaaxp.assigned_to"   >
        <el-radio-button v-for="item in assigned_toList" :key="item.value" :label="item.value" >
            {{item.name}}
        </el-radio-button>
      </el-radio-group>
    </el-form-item>
    </el-col>
    <el-col :span="12">
    <!-- {"index":48,"raw":"assigned_date","name":"assigned_date","cname":"AssignedDate","type":{"raw":"date","name":"date","len":0,"dlen":0},"defValue":"","allowNull":true,"constraints":["v","le","q","tp(daterange,q)","w"],"desc":{"raw":"分配时间","name":"分配时间"}} -->
    <!--分配时间 日期控件 -->
    <el-form-item prop="assigned_date" label="分配时间" label-width="100px" label-position="right">
      <el-date-picker style="width: 100%" v-model="form_aaaxp.assigned_date" clearable type="date"
          placeholder="请选择分配时间" format="YYYY-MM-DD" value-format="YYYY-MM-DD" />
    </el-form-item>
    </el-col>
    <el-col :span="12"></el-col>
    <el-col :span="24">
    <!-- {"index":51,"raw":"^content","name":"content","cname":"Content","type":{"raw":"number(20)","name":"number","len":20,"dlen":0},"defValue":"","allowNull":true,"constraints":["w","ps(full)","rows(4)"],"desc":{"raw":"内容","name":"内容"}} -->
    <!--内容 输入控件 -->
    <el-form-item prop="content" label="内容" label-width="100px" label-position="right">
      <el-input clearable style="width: 100%" v-model="form_aaaxp.content"  maxlength="20" 
      :rows="4"  type="textarea" show-word-limit  placeholder="请输入内容"  />
      </el-form-item>
    </el-col>
    </el-row>
    </el-form>
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="hide_aaaxp" icon="close">取消</el-button>
        <el-button type="primary" @click="save_aaaxp" icon="select">提交</el-button>
      </span>
    </template>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data(){
    return{
      conf:{
        aaaxp_visible:false,//指派
      },
      form_aaaxp:{},//指派
      //指派
      rules_aaaxp:{ 
        assigned_to:[{required:false, message:"请输入指派", trigger: 'blur'}], 
        assigned_date:[{required:false, message:"请输入分配时间", trigger: 'blur'}], 
        content:[{required:false, message:"请输入内容", trigger: 'blur'}],
      },
    }
  },
  methods:{
     //--------------------指派---------------------------------
      //显示 指派 弹出框
      show_aaaxp(fm){
        //处理输入参数
        let currentForm = {}
        Object.assign(this.form_aaaxp,currentForm)
        this.form_aaaxp.assigned_to = fm.assigned_to
        this.form_aaaxp.assigned_date = fm.assigned_date
        this.form_aaaxp.content = fm.content
        //特殊参数处理
        // this.form_aaaxp.bug_id = (this.bcheck||[]).join(",")
        this.loadEnums_aaaxp()
        this.conf.aaaxp_visible = true;
      },

      //隐藏 指派 弹出框
      hide_aaaxp(){
        this.conf.aaaxp_visible = false;
        this.$refs.fm_aaaxp.resetFields();
      },

      //保存 指派 弹出框数据
      save_aaaxp(){
        let that = this
        this.$refs.fm_aaaxp.validate((v=>{
          if(!v) return
          let post_form_aaaxp = this.form_aaaxp
          this.$theia.http.post("/ws/test/bug//ws/test/bug/assign",post_form_aaaxp).then(res=>{
            that.$notify.success({title: '成功',message: '提交成功',duration:5000})
            that.$emit("onsaved")
            that.hide_aaaxp()
          }).catch(res=>{
            let code = ((res||{}).response||{}).status||0
            let msg= `提交失败(${code})`
            that.$notify.error({title: '失败',message:msg,duration:5000})
          })
      }))
    },
    //指派
    loadEnums_aaaxp(){
        //指派
        this.assigned_toList = this.$theia.enum.get("dmaster","",this.$theia.user.get("lob_id"),false,"")
    },

  },
}
</script>
<style scoped>
.form_item_info{
  margin-left: 4px;
  color:#999;
}
.form_item_info:hover{
  cursor: pointer;
  font-weight: 500;
  color:#333;
}
</style>